package com.itheima.ao1threadcase3;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class ThreadDemo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //指定线程的运行任务
        MyCallable mc=new MyCallable();
        //管理执行结果
        FutureTask<Integer> ft=new FutureTask<>(mc);
        //启动线程
        Thread tr=new Thread(ft);
        tr.start();
        System.out.println("运行结果："+ft.get());
    }
}
